From: Aaron Date: Thu, 20 Sep 2012 20:47:15 +0000 (-0700) Subject: [FileRepo] Throw an exception if a storage key is invalid. X-Git-Tag: 1.31.0-rc.0~22284^2 X-Git-Url: http://git.cyclocoop.org/%28%5B%5E/404?a=commitdiff_plain;h=407ab3898b5d08a0d8c9f5142de47d9b14124da6;p=lhc%2Fweb%2Fwiklou.git [FileRepo] Throw an exception if a storage key is invalid. Change-Id: Ie479d940dddcf7a9eca5d68a76fbe3fa70a6d4d7 --- diff --git a/includes/filerepo/FileRepo.php b/includes/filerepo/FileRepo.php index a31b148aeb..5f24fedc13 100644 --- a/includes/filerepo/FileRepo.php +++ b/includes/filerepo/FileRepo.php @@ -1321,6 +1321,9 @@ class FileRepo { * @return string */ public function getDeletedHashPath( $key ) { + if ( strlen( $key ) < 31 ) { + throw new MWException( "Invalid storage key '$key'." ); + } $path = ''; for ( $i = 0; $i < $this->deletedHashLevels; $i++ ) { $path .= $key[$i] . '/';